<?php 
class enderecoController extends CController{
    public $model_name = 'pessoal/endereco';
    public function __construct($vars) {
        $this->addToFreeCod('cep');
        parent::__construct($vars);
    }
    
    public function cep(){
        $cep = array_shift($this->vars);
        $end = $this->model->findAdress($cep);
        echo json_encode($end);
    }
}
?>